<?php
declare (strict_types = 1);

namespace app\model\table\season;

use app\model\BaseModel;

/**
 * @mixin \think\Model
 */
class SeasonConfig extends BaseModel
{
    protected $table = 'app_season_config';

    // 是否全表缓存到redis
    public $tableToRedis = false;

    // 该表缓存到redis的策略
    public $tableToRedisKey = [];

    public $joinWithList=array(
    );

    /**
     * 获取当前赛季
     * @return array|mixed|string
     */
    public function getNow()
    {
        $time = date("Y-m-d H:i:s", time());
        $where = array();
        $where[] = ['stime','<=',$time];
        $where[] = ['etime','>=',$time];
        return SeasonConfig::instance()->findOne($where);
    }
}
